package com.runa.persistence.entity.gw;

import com.alibaba.fastjson.annotation.JSONField;
import com.runa.persistence.DateUtil;
import lombok.Data;

/**
 * 2025/1/15 13:28
 * zhangYB
 */
@Data
public class GwDown {

    @JSONField(name = "Func")
    private String Func = "down";

    @JSONField(name = "Id")
    private String Id;

    @JSONField(name = "Param")
    private GwDownParam Param;

    @JSONField(name = "Seq")
    private String Seq = String.valueOf(System.currentTimeMillis());

    @JSONField(name = "Time")
    private Long Time = System.currentTimeMillis() / 1000;

    public static GwDown getDownTiming(String id) {
        GwDownParamData data = new GwDownParamData("setdatetime", DateUtil.dateTimeNow());
        GwDownParam param = new GwDownParam(data, "ctrl");
        GwDown gwDown = new GwDown();
        gwDown.setId(id);
        gwDown.setParam(param);
        return gwDown;
    }

}
